import { Dayjs } from "dayjs";
import { ISelectObj } from "@/utils/types/key-value-any.ts";

export interface ISearch {
  label: string;
  value: string;
  type: "select" | "loadSelect" | "input" | "timeRange" | "monthRange";
  selectDict?: string;
  selectUrl?: string;
  handle?: (value: string) => void;
}

export type RangeValue = [Dayjs, Dayjs];
export interface IShowtimes {
  format: string;
  defaultValue: RangeValue;
}
export interface ITypeState {
  selectObj: ISelectObj;
  selectList: Array<ISelectObj>;
  selectValue: string;
  inputVal: string;
  selectStatusVal: string | [];
  showTimes: IShowtimes;
}
export interface IAsyncDict {
  message: string;
  name: string;
  code?: string;
}
export interface IDictSelect {
  value: string;
  label: string;
}
export const selectObjInit: ISelectObj = {
  label: "",
  value: "",
  type: "input",
  selectDict: "",
};
